<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/css/asset/bootstrap/bootstrap.css" />
<link rel="stylesheet" href="/css/asset/bootstrap/bootstrap-theme.css" />
<link rel="stylesheet"
	href="/css/asset/bootstrap/bootstrap-responsive.css" />
<link rel="stylesheet"
	href="/css/asset/bootstrap/bootstrap-tour.min.css" />
<script type="text/javascript" src="/js/asset/bootstrap/bootstrap.js"></script>
<script type="text/javascript"
	src="/js/asset/bootstrap/bootstrap-tour.min.js"></script>
</head>
<body>
	<div class="container">
		<nav class="navbar navbar-default" role="navigation">
			<div class="container-fluid">
				<div class="navbar-header">
					<div class="navbar-brand">Task Monitor</div>
				</div>
			</div>
		</nav>
		<table class="table table-hover table-condensed">
			<thead>
				<tr>
					<th>NO.</th>
					<th>File Name</th>
					<th>Task ID</th>
					<th>IP</th>
					<th>Start Time</th>
					<th>End Time</th>
					<th>Status</th>
					<th> </th>
				</tr>
			</thead>
			<tbody>
			<c:forEach items="${itemList}" var="item">
			<tr class="
				<c:if test="${item.status == 'COMPLETE'}">success</c:if>
				<c:if test="${item.status == 'QUEUE' || item.status == 'PROCESSING'}">warning</c:if>
			">
				<th>${item.number}</th>
				<th>${item.fileName}</th>
				<th>${item.taskId}</th>
				<th>${item.ip}</th>
				<th>${item.startTime}</th>
				<th>${item.endTime}</th>
				<th>${item.status}</th>
				<th>
				<c:if test="${item.status == 'COMPLETE' }">
					<a class="btn btn-info btn-xs" 
					href="task_monitor_detail.html?file_id=${item.fileId}&task_id=${item.taskId}">Detail</a>
				</c:if>
				</th>
			</tr>
			</c:forEach>
			</tbody>
		</table>
	</div>
</body>
</html>
